package com.dqp.cslggroup.UI;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.dqp.cslggroup.R;
import com.dqp.cslggroup.bean.Grade;

import java.util.List;

public class GradeMoreAdapter extends BaseAdapter {

    private List<Grade> gradeList;
    private LayoutInflater inflater;
    private GradeMoreAdapter gradeMoreAdapter;

    public GradeMoreAdapter(List<Grade> grades, Context context) {
        this.gradeList = grades;
        this.inflater = LayoutInflater.from(context);
    }


    public int getCount() {
        return gradeList == null ? 0 : gradeList.size();
    }


    public Object getItem(int position) {
        return gradeList.get(position);
    }


    public long getItemId(int position) {
        return position;
    }


    public View getView(int position, View convertView, ViewGroup parent) {
        @SuppressLint("ViewHolder") View view = inflater.inflate(R.layout.grade_more_item, null);
        Grade grade = (Grade) getItem(position);
        TextView cjfx = view.findViewById(R.id.cjfx);
        TextView fxbl = view.findViewById(R.id.fxbl);
        TextView cj = view.findViewById(R.id.cj);
        cjfx.setText(grade.getFx());
        fxbl.setText(grade.getBl());
        cj.setText(grade.getCj());
        return view;
    }


}

